import string

name = "\nzHbn gbs \t {_name}"
print(name.capitalize())  # 首字母大写
print(name.count("a"))  # 求字母有几个
print(name.center(50, "A"))  # 长度，其余用A补上
print(name.endswith("s"))  # 判断以什么结尾
print(name.expandtabs(tabsize=30))
print(name[name.find("b"):])  # 查找字符数索引
print(name.format(_name="test"))
print(name.format_map({'_name': 'alex'}))
print(name.isalnum())  # 判断是不是阿拉伯数字
print("a1A".isidentifier())  # 判断是不是一个合法的标识符、变量名
print(' '.isspace())  # 是不是空格
print('My Name Is'.istitle())
print('My Name Is'.join('##'))
print(','.join(['1', '2', '3']))  # 间隔
print(name.ljust(50, '*'))  # 往后填写
print(name.rjust(50, '*'))
print(name.lower())
print(name.upper())
print(name.lstrip('b'))  # 从左边去掉空格
print('\nna me \n '.lstrip())  # 从左边去掉空格
print('      na    me.     \n '.strip())  # 从左边去掉空格
"""
 maketrans on python3.x 
"""
s = 'abcde'
p = s.maketrans('e', '1')
print(s.translate(p))
